/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package sheep.view.jung.utils;

/**
 *
 * @author geek
 */
import java.awt.Color;
import java.awt.Paint;
import java.awt.Shape;
import edu.uci.ics.jung.graph.Vertex;
import edu.uci.ics.jung.graph.decorators.AbstractVertexShapeFunction;
import edu.uci.ics.jung.graph.decorators.VertexAspectRatioFunction;
import edu.uci.ics.jung.graph.decorators.VertexPaintFunction;
import edu.uci.ics.jung.graph.decorators.VertexSizeFunction;
import sheep.model.Task;

/** Choix de la forme des VERTEX **/
public class VertexShape extends AbstractVertexShapeFunction implements VertexSizeFunction, VertexAspectRatioFunction,VertexPaintFunction 
{ 
  public VertexShape()
 {
      setSizeFunction(this);
      setAspectRatioFunction(this);
 } 
 public int getSize(Vertex v)
 {
      return (int)(40);
 }
 public float getAspectRatio(Vertex v)
 {
      return 1.0f;
 }
 public Shape getShape(Vertex v)
 {
     return factory.getRoundRectangle(v);
 }
 
 public Paint getDrawPaint(Vertex v){ 
     return Color.BLACK; 
   } 
  
 public Paint getFillPaint(Vertex v) 
 { 
   Task task =(Task)v.getUserDatum("Key"); 

     return Color.red; 
 }  
}